<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.EditContactTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.EditContactLabel_contactID}" for="contactID" />
                    <h:inputText id="contactID" value="#{contactController.selected.contactID}" title="#{bundle.EditContactTitle_contactID}" />
                    <h:outputLabel value="#{bundle.EditContactLabel_name}" for="name" />
                    <h:inputText id="name" value="#{contactController.selected.name}" title="#{bundle.EditContactTitle_name}" required="true" requiredMessage="#{bundle.EditContactRequiredMessage_name}"/>
                    <h:outputLabel value="#{bundle.EditContactLabel_address}" for="address" />
                    <h:inputText id="address" value="#{contactController.selected.address}" title="#{bundle.EditContactTitle_address}" required="true" requiredMessage="#{bundle.EditContactRequiredMessage_address}"/>
                    <h:outputLabel value="#{bundle.EditContactLabel_tell}" for="tell" />
                    <h:inputText id="tell" value="#{contactController.selected.tell}" title="#{bundle.EditContactTitle_tell}" required="true" requiredMessage="#{bundle.EditContactRequiredMessage_tell}"/>
                    <h:outputLabel value="#{bundle.EditContactLabel_fax}" for="fax" />
                    <h:inputText id="fax" value="#{contactController.selected.fax}" title="#{bundle.EditContactTitle_fax}" />
                    <h:outputLabel value="#{bundle.EditContactLabel_email}" for="email" />
                    <h:inputText id="email" value="#{contactController.selected.email}" title="#{bundle.EditContactTitle_email}" required="true" requiredMessage="#{bundle.EditContactRequiredMessage_email}"/>
                    <h:outputLabel value="#{bundle.EditContactLabel_question}" for="question" />
                    <h:inputText id="question" value="#{contactController.selected.question}" title="#{bundle.EditContactTitle_question}" required="true" requiredMessage="#{bundle.EditContactRequiredMessage_question}"/>
                    <h:outputLabel value="#{bundle.EditContactLabel_comment}" for="comment" />
                    <h:inputText id="comment" value="#{contactController.selected.comment}" title="#{bundle.EditContactTitle_comment}" required="true" requiredMessage="#{bundle.EditContactRequiredMessage_comment}"/>
                    <h:outputLabel value="#{bundle.EditContactLabel_dateCreated}" for="dateCreated" />
                    <h:inputText id="dateCreated" value="#{contactController.selected.dateCreated}" title="#{bundle.EditContactTitle_dateCreated}" required="true" requiredMessage="#{bundle.EditContactRequiredMessage_dateCreated}"/>
                    <h:outputLabel value="#{bundle.EditContactLabel_isActive}" for="isActive" />
                    <h:inputText id="isActive" value="#{contactController.selected.isActive}" title="#{bundle.EditContactTitle_isActive}" />
                    <h:outputLabel value="#{bundle.EditContactLabel_approved}" for="approved" />
                    <h:inputText id="approved" value="#{contactController.selected.approved}" title="#{bundle.EditContactTitle_approved}" />
                </h:panelGrid>
                <h:commandLink action="#{contactController.update}" value="#{bundle.EditContactSaveLink}"/>
                <br />
                <br />
                <h:commandLink action="View" value="#{bundle.EditContactViewLink}" immediate="true"/>
                <br />
                <h:commandLink action="#{contactController.prepareList}" value="#{bundle.EditContactShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:commandLink value="#{bundle.EditContactIndexLink}" action="/index" immediate="true" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
